/*
 *  This file is part of the SIRIUS libraries for analyzing MS and MS/MS data
 *
 *  Copyright (C) 2024 Bright Giant GmbH
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with SIRIUS.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 *  https://openapi-generator.tech
 *  Do not edit the class manually.
 */


package io.sirius.ms.sdk.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.sirius.ms.sdk.model.JobEffect;
import io.sirius.ms.sdk.model.JobProgress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * Identifier created by the SIRIUS Nightsky API for a newly created Job.  Object can be enriched with Job status/progress information ({@link JobProgress JobProgress}) and/or Job command information.  This is a return value of the API. So nullable values can also be NOT_REQUIRED to allow for easy removal.
 */
@JsonPropertyOrder({
  Job.JSON_PROPERTY_ID,
  Job.JSON_PROPERTY_COMMAND,
  Job.JSON_PROPERTY_PROGRESS,
  Job.JSON_PROPERTY_AFFECTED_COMPOUND_IDS,
  Job.JSON_PROPERTY_AFFECTED_ALIGNED_FEATURE_IDS,
  Job.JSON_PROPERTY_JOB_EFFECT
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0")
public class Job {
  public static final String JSON_PROPERTY_ID = "id";
  @jakarta.annotation.Nullable
  private String id;

  public static final String JSON_PROPERTY_COMMAND = "command";
  @jakarta.annotation.Nullable
  private String command;

  public static final String JSON_PROPERTY_PROGRESS = "progress";
  @jakarta.annotation.Nullable
  private JobProgress progress;

  public static final String JSON_PROPERTY_AFFECTED_COMPOUND_IDS = "affectedCompoundIds";
  @jakarta.annotation.Nullable
  private List<String> affectedCompoundIds;

  public static final String JSON_PROPERTY_AFFECTED_ALIGNED_FEATURE_IDS = "affectedAlignedFeatureIds";
  @jakarta.annotation.Nullable
  private List<String> affectedAlignedFeatureIds;

  public static final String JSON_PROPERTY_JOB_EFFECT = "jobEffect";
  @jakarta.annotation.Nullable
  private JobEffect jobEffect;

  public Job() {
  }

  public Job id(@jakarta.annotation.Nullable String id) {
    
    this.id = id;
    return this;
  }

  /**
   * Unique identifier to access the job via the API
   * @return id
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getId() {
    return id;
  }


  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setId(@jakarta.annotation.Nullable String id) {
    this.id = id;
  }

  public Job command(@jakarta.annotation.Nullable String command) {
    
    this.command = command;
    return this;
  }

  /**
   * Command string of the executed Task
   * @return command
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_COMMAND)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getCommand() {
    return command;
  }


  @JsonProperty(JSON_PROPERTY_COMMAND)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setCommand(@jakarta.annotation.Nullable String command) {
    this.command = command;
  }

  public Job progress(@jakarta.annotation.Nullable JobProgress progress) {
    
    this.progress = progress;
    return this;
  }

  /**
   * Get progress
   * @return progress
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PROGRESS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JobProgress getProgress() {
    return progress;
  }


  @JsonProperty(JSON_PROPERTY_PROGRESS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setProgress(@jakarta.annotation.Nullable JobProgress progress) {
    this.progress = progress;
  }

  public Job affectedCompoundIds(@jakarta.annotation.Nullable List<String> affectedCompoundIds) {
    
    this.affectedCompoundIds = affectedCompoundIds;
    return this;
  }

  public Job addAffectedCompoundIdsItem(String affectedCompoundIdsItem) {
    if (this.affectedCompoundIds == null) {
      this.affectedCompoundIds = new ArrayList<>();
    }
    this.affectedCompoundIds.add(affectedCompoundIdsItem);
    return this;
  }

  /**
   * List of compoundIds that are affected by this job.  This lis will also contain compoundIds where not all features of the compound are affected by the job.  If this job is creating compounds (e.g. data import jobs) this value will be NULL until the jobs has finished
   * @return affectedCompoundIds
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_AFFECTED_COMPOUND_IDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<String> getAffectedCompoundIds() {
    return affectedCompoundIds;
  }


  @JsonProperty(JSON_PROPERTY_AFFECTED_COMPOUND_IDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAffectedCompoundIds(@jakarta.annotation.Nullable List<String> affectedCompoundIds) {
    this.affectedCompoundIds = affectedCompoundIds;
  }

  public Job affectedAlignedFeatureIds(@jakarta.annotation.Nullable List<String> affectedAlignedFeatureIds) {
    
    this.affectedAlignedFeatureIds = affectedAlignedFeatureIds;
    return this;
  }

  public Job addAffectedAlignedFeatureIdsItem(String affectedAlignedFeatureIdsItem) {
    if (this.affectedAlignedFeatureIds == null) {
      this.affectedAlignedFeatureIds = new ArrayList<>();
    }
    this.affectedAlignedFeatureIds.add(affectedAlignedFeatureIdsItem);
    return this;
  }

  /**
   * List of alignedFeatureIds that are affected by this job.  If this job is creating features (e.g. data import jobs) this value will be NULL until the jobs has finished
   * @return affectedAlignedFeatureIds
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_AFFECTED_ALIGNED_FEATURE_IDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List<String> getAffectedAlignedFeatureIds() {
    return affectedAlignedFeatureIds;
  }


  @JsonProperty(JSON_PROPERTY_AFFECTED_ALIGNED_FEATURE_IDS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setAffectedAlignedFeatureIds(@jakarta.annotation.Nullable List<String> affectedAlignedFeatureIds) {
    this.affectedAlignedFeatureIds = affectedAlignedFeatureIds;
  }

  public Job jobEffect(@jakarta.annotation.Nullable JobEffect jobEffect) {
    
    this.jobEffect = jobEffect;
    return this;
  }

  /**
   * Get jobEffect
   * @return jobEffect
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_JOB_EFFECT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JobEffect getJobEffect() {
    return jobEffect;
  }


  @JsonProperty(JSON_PROPERTY_JOB_EFFECT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setJobEffect(@jakarta.annotation.Nullable JobEffect jobEffect) {
    this.jobEffect = jobEffect;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Job job = (Job) o;
    return Objects.equals(this.id, job.id) &&
        Objects.equals(this.command, job.command) &&
        Objects.equals(this.progress, job.progress) &&
        Objects.equals(this.affectedCompoundIds, job.affectedCompoundIds) &&
        Objects.equals(this.affectedAlignedFeatureIds, job.affectedAlignedFeatureIds) &&
        Objects.equals(this.jobEffect, job.jobEffect);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, command, progress, affectedCompoundIds, affectedAlignedFeatureIds, jobEffect);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Job {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    command: ").append(toIndentedString(command)).append("\n");
    sb.append("    progress: ").append(toIndentedString(progress)).append("\n");
    sb.append("    affectedCompoundIds: ").append(toIndentedString(affectedCompoundIds)).append("\n");
    sb.append("    affectedAlignedFeatureIds: ").append(toIndentedString(affectedAlignedFeatureIds)).append("\n");
    sb.append("    jobEffect: ").append(toIndentedString(jobEffect)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

